<template>
	<view>
		<view class="body">
			<view v-for="(item, index) in imgList">
				<view class="text" @click="productUrl(item.id)">
					<image class="image-list" :src="Url + item.categoryImage" mode="aspectFill"></image>
					<text style="color: black">{{ item.categoryName }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { baseUrl } from '../../../config.js';

export default {
	name: 'imgs',
	data() {
		return {
			Url: baseUrl
		};
	},
	properties: {
		imgList: {
			type: Array,
			required: true
		}
	},
	methods: {
		productUrl(id) {
			uni.navigateTo({
				url: '/subPages/main/productList?id=' + id
			});
		}
	},
	mounted() {},
	onShow() {},
	onLoad() {}
};
</script>

<style lang="less">
.body {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	margin: 30rpx;

	.text {
		display: flex;
		flex-direction: column;
		align-items: center;

		font-size: 26rpx;
	}
}
</style>
